﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace MyERP.Models
{
    /// <summary>
    /// 物品实体类
    /// </summary>
    public class Goods
    {
        public int Id { get; set; }
        public string Name { get; set; }
        /// <summary>
        /// 物品规格
        /// </summary>
        public string Specification { get; set; }
    }
    public class GoodsConfig : IEntityTypeConfiguration<Goods>
    {
        public void Configure(EntityTypeBuilder<Goods> builder)
        {
            builder.ToTable("T_Goods");
            builder.Property(e => e.Name).HasMaxLength(20);
            builder.Property(e => e.Specification).HasMaxLength(20);
        }
    }
}
